package fr.fermat.control;

import fr.fermat.network.LyricService;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Controller {

	private LyricService service;
	private String lyricView="";
	
	public Controller() {
		
	}
	
	 public boolean isConnectingToInternet(Context context){
	        ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
	          if (connectivity != null) 
	          {
	              NetworkInfo[] info = connectivity.getAllNetworkInfo();
	              if (info != null) 
	                  for (int i = 0; i < info.length; i++) 
	                      if (info[i].getState() == NetworkInfo.State.CONNECTED)
	                      {
	                          return true;
	                      }
	 
	          }
	          return false;
	    }
	 
	 public LyricService getService() {
		 return this.service;
	 }
	 
	 public void setService(LyricService service) {
		  this.service = service;
	 }

	public String getLyricView() {
		return lyricView;
	}

	public void setLyricView(String lyricView) {
		this.lyricView = lyricView;
	}
	 
}
